package songhq.com.mongo.controller;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import songhq.com.mongo.service.ExcelService;
import songhq.com.mongo.utils.EasyExcelUtil;
import songhq.com.mongo.vo.SchoolScheduleVO;

@Controller
@RequestMapping("/excel")
public class SchoolExcelController {
	
	@Autowired
	private ExcelService excelService;
	
	@RequestMapping(value = "/doUpload", method = RequestMethod.POST)
	@ResponseBody
	public String doUploadCoupon(HttpServletRequest request, @RequestParam("upload") MultipartFile excel) {
		try {
			excelService.readSchedule(excel);
			return "读取成功";
		}catch (Exception e) {
			System.out.println(e.getStackTrace());
			return "读取失败";
		}

	}
}
